/*
 * sys_struct.h
 *
 *  Created on: 2011-7-30
 *      Author: SL400
 */

#ifndef SYS_STRUCT_H_
#define SYS_STRUCT_H_

#include "types.h"
#include "consts.h"

/*super block defination*/
typedef struct{
    dword n_total_blks; /*total number of blocks of file system*/
    dword n_inode_blks; /*number of inode blocks of file system*/
    
    byte f_block_modify; /*is the structure modified in the memory*/
    byte f_dl_lock; 
    byte f_il_lock;
    
    dword n_data_cnt;
    dword data_buffer[BLK_BF_SIZE];
    
    dword n_inode_cnt;
    dword inode_buffer[BLK_BF_SIZE];
    
    byte pad[45];
}super_block;

/*defination of inode on the disk*/
typedef struct{
    dword i_mode;
    dword i_create_time;
    dword i_modify_time;

    dword data_addr[4];

    char i_name[MAX_FILENAME_LENGTH];
}inode_disk;

#endif /* SYS_STRUCT_H_ */
